3.3.89 \(\int \sec ^2(e+f x) (a+b \sin ^2(e+f x)) \, dx\) [289]

Optimal. Leaf size=18 \[ -b x+\frac {(a+b) \tan (e+f x)}{f} \]

[Out]

-b*x+(a+b)*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3270, 396, 209} \begin {gather*} \frac {(a+b) \tan (e+f x)}{f}-b x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2),x]

[Out]

-(b*x) + ((a + b)*Tan[e + f*x])/f

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 3270

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a+(a+b) x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a+b) \tan (e+f x)}{f}-\frac {b \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-b x+\frac {(a+b) \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 36, normalized size = 2.00 \begin {gather*} -\frac {b \tan ^{-1}(\tan (e+f x))}{f}+\frac {a \tan (e+f x)}{f}+\frac {b \tan (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2),x]

[Out]

-((b*ArcTan[Tan[e + f*x]])/f) + (a*Tan[e + f*x])/f + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]
time = 0.27, size = 30, normalized size = 1.67

method result size
derivativedivides \(\frac {\tan \left (f x +e \right ) a +b \left (\tan \left (f x +e \right )-f x -e \right )}{f}\) \(30\)
default \(\frac {\tan \left (f x +e \right ) a +b \left (\tan \left (f x +e \right )-f x -e \right )}{f}\) \(30\)
risch \(-b x +\frac {2 i a}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {2 i b}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(46\)
norman \(\frac {b x +b x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {4 \left (a +b \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (a +b \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}\) \(135\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(tan(f*x+e)*a+b*(tan(f*x+e)-f*x-e))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 33, normalized size = 1.83 \begin {gather*} -\frac {{\left (f x + e - \tan \left (f x + e\right )\right )} b - a \tan \left (f x + e\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="maxima")

[Out]

-((f*x + e - tan(f*x + e))*b - a*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 35, normalized size = 1.94 \begin {gather*} -\frac {b f x \cos \left (f x + e\right ) - {\left (a + b\right )} \sin \left (f x + e\right )}{f \cos \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="fricas")

[Out]

-(b*f*x*cos(f*x + e) - (a + b)*sin(f*x + e))/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin ^{2}{\left (e + f x \right )}\right ) \sec ^{2}{\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**2*(a+b*sin(f*x+e)**2),x)

[Out]

Integral((a + b*sin(e + f*x)**2)*sec(e + f*x)**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (19) = 38\).
time = 0.45, size = 49, normalized size = 2.72 \begin {gather*} -\frac {{\left (f x - \pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor + e - \tan \left (f x + e\right )\right )} b - a \tan \left (f x + e\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="giac")

[Out]

-((f*x - pi*floor((f*x + e)/pi + 1/2) + e - tan(f*x + e))*b - a*tan(f*x + e))/f

________________________________________________________________________________________

Mupad [B]
time = 13.64, size = 26, normalized size = 1.44 \begin {gather*} \frac {a\,\mathrm {tan}\left (e+f\,x\right )+b\,\mathrm {tan}\left (e+f\,x\right )-b\,f\,x}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x)^2)/cos(e + f*x)^2,x)

[Out]

(a*tan(e + f*x) + b*tan(e + f*x) - b*f*x)/f

________________________________________________________________________________________